package top.jacktgq.hsp.netty.tcp_selfprotocal;

import io.netty.util.CharsetUtil;

/**
 * @Author CandyWall
 * @Date 2020/11/13--17:35
 * @Description
 */
public class MessageProtocal {
    private int len;   //关键
    private byte[] content;

    public MessageProtocal(int len, byte[] content) {
        this.len = len;
        this.content = content;
    }

    public int getLen() {
        return len;
    }

    public void setLen(int len) {
        this.len = len;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "MessageProtocal{" +
                "len=" + len +
                ", content=" + new String(content, CharsetUtil.UTF_8) +
                '}';
    }
}
